

cd "[insert your directory]"
global PathFig "[insert your directory]"

* Importing packages
* ssc install estout
* ssc install ftools
* ssc install reghdfe
* ssc install cibar
* ssc install rev
* ssc install sutex
* ssc install cibar
* ssc install ipfweight
* ssc install ciplot


**************************************************************************************************
*************  Figure S2: Injuctive norms (Raw data and weights), Greece *************************
**************************************************************************************************
use "GR_recoded_stage1_2.dta", clear


label var contributing_1_rev "Welfare norm"
label var accepting_3_rev "Gender equity"
label var contributing_1_rev "Welfare norm"
label var accepting_3_rev "Gender equity"
 

* Data cleaning
label var gender_cat1 "Male"
label var age_cat1 "Age: 18-34"
label var age_cat2 "Age: 35-54"
label var age_cat3 "Age: 55-90"

label var region_GR1 "Attiki"
label var region_GR2 "Voreia Ellada"
label var region_GR3 "Kentriki Ellada"
label var region_GR4 "Nisia Aigaiou and Kriti"


drop if gender==3
gen FEMALE=0
replace FEMALE=1 if gender==2
drop age_cat age_cat1 age_cat2 age_cat3
recode age (18/34=1) (35/54=2) (55/90=3) (.2 = .), gen(age_cat)
tab age_cat, gen(age_)


mean FEMALE age_1 age_2 age_3 postsecondary region_GR1 region_GR2 region_GR3 region_GR4 right
estat sd

gen NUTS1=.
replace NUTS1=1 if NUTS1_string=="Attiki"
replace NUTS1=2 if NUTS1_string=="Voreia Ellada"
replace NUTS1=3 if NUTS1_string=="Kentriki Ellada"
replace NUTS1=4 if NUTS1_string=="Nisia Aigaiou and Kriti"

ipfweight FEMALE age_cat NUTS1, gen(weight_new2) val(48.6 51.4 21.2 35.4 43.3 31.3 29.5 28.1 11.1) maxiter(100) 

svyset ResponseId [pweight=weight_new2]
svy: mean FEMALE age_1 age_2 age_3 region_GR1 region_GR2 region_GR3 region_GR4
estat sd



* Figure S2
ciplot contributing_1_rev contributing_2_rev obeying_1_rev accepting_3_rev , note("") xlabel(, angle(0)) xtitle("Greece")  rcap(lcolor(black)) name(injunctive, replace) yline(5) ytitle("Disapproval (0 - 10)") ylabel(3(1)8) 
ciplot contributing_1_rev contributing_2_rev obeying_1_rev accepting_3_rev [aweight = weight_new], note("") xlabel(, angle(0)) xtitle("Greece")  rcap(lcolor(black)) name(injunctive_weight, replace) yline(5) ytitle("Disapproval (0 - 10)") ylabel(3(1)8) 

graph combine injunctive injunctive_weight, ycommon title("Greece")
graph export "${PathFig}FigureS2.eps", as(eps) replace

clear


**************************************************************************************************
*********************  Figure S3: Senitivity to statement wording ********************************
**************************************************************************************************

* Load data

use "GR_stage1_2.dta", clear
gen robustness=0
append using "GR_robustness.dta"
replace robustness=1 if robustness==.


*************** Cleaning Data *******************

recode gender (1=1) (2=2) (else=.), gen(gender_cat) 
recode age (18/34=1) (35/54=2) (55/90=3) (.2 = .), gen(age_cat)
 
tab gender_cat, gen(gender_cat)
tab age_cat, gen(age_cat)

keep if partychoice!=.
label var gender_cat1 "Male"
label var age_cat1 "Age: 18-34"
label var age_cat2 "Age: 35-54"
label var age_cat3 "Age: 55-90"

gen perifereia=""
replace perifereia="ipeirou" if prefecture_1==7
replace perifereia="anatol_mak" if prefecture_1==14
replace perifereia="dyt_ell" if prefecture_1==3
replace perifereia="peloponnisou" if prefecture_1==5
replace perifereia="peloponnisou" if prefecture_1==6
replace perifereia="attikis" if prefecture_1==4 | prefecture_1==2 | prefecture_1==12 | prefecture_1==41
replace perifereia="dyt_ell" if prefecture_1==8
replace perifereia="stereas" if prefecture_1==9
replace perifereia="dytikis_mak" if prefecture_1==10
replace perifereia="anatol_mak" if prefecture_1==11
replace perifereia="notiou_aig" if prefecture_1==13
replace perifereia="stereas" if prefecture_1==16
replace perifereia="stereas" if prefecture_1==15
replace perifereia="ionion" if prefecture_1==17
replace perifereia="dyt_ell" if prefecture_1==18
replace perifereia="kentr_mak" if prefecture_1==19
replace perifereia="kritis" if prefecture_1==20
replace perifereia="ipeirou" if prefecture_1==21
replace perifereia="kentr_mak" if prefecture_1==22
replace perifereia="ipeirou" if prefecture_1==23
replace perifereia="ionion" if prefecture_1==27
replace perifereia="anatol_mak" if prefecture_1==24
replace perifereia="thessalias" if prefecture_1==25
replace perifereia="dytikis_mak" if prefecture_1==26
replace perifereia="ionion" if prefecture_1==28
replace perifereia="kentr_mak" if prefecture_1==29
replace perifereia="dytikis_mak" if prefecture_1==30
replace perifereia="peloponnisou" if prefecture_1==31
replace perifereia="notiou_aig" if prefecture_1==32
replace perifereia="thessalias" if prefecture_1==34
replace perifereia="voreiou_aig" if prefecture_1==36
replace perifereia="peloponnisou" if prefecture_1==33
replace perifereia="kritis" if prefecture_1==35
replace perifereia="thessalias" if prefecture_1==38
replace perifereia="anatol_mak" if prefecture_1==40
replace perifereia="kentr_mak" if prefecture_1==42
replace perifereia="kentr_mak" if prefecture_1==43
replace perifereia="ipeirou" if prefecture_1==44
replace perifereia="kritis" if prefecture_1==45
replace perifereia="anatol_mak" if prefecture_1==46
replace perifereia="voreiou_aig" if prefecture_1==47
replace perifereia="kentr_mak" if prefecture_1==48
replace perifereia="thessalias" if prefecture_1==49
replace perifereia="stereas" if prefecture_1==50
replace perifereia="dytikis_mak" if prefecture_1==51
replace perifereia="stereas" if prefecture_1==52
replace perifereia="voreiou_aig" if prefecture_1==55
replace perifereia="kentr_mak" if prefecture_1==53
replace perifereia="kritis" if prefecture_1==54
replace perifereia="ionion" if prefecture_1==37
replace perifereia="peloponnisou" if prefecture_1==39

gen NUTS1_string=""
replace NUTS1_string="Attiki" if perifereia=="attikis"
replace NUTS1_string="Voreia Ellada" if perifereia=="anatol_mak" | perifereia=="kentr_mak" | perifereia=="dytikis_mak" | perifereia=="ipeirou" 
replace NUTS1_string="Kentriki Ellada" if perifereia=="thessalias" | perifereia=="ionion" | perifereia=="dyt_ell" | perifereia=="stereas" | perifereia=="peloponnisou"
replace NUTS1_string="Nisia Aigaiou and Kriti" if perifereia=="voreiou_aig" | perifereia=="notiou_aig" | perifereia=="kritis"

gen region=.
replace region=1 if NUTS1_string=="Attiki"
replace region=2 if NUTS1_string=="Voreia Ellada"
replace region=3 if NUTS1_string=="Kentriki Ellada"
replace region=4 if NUTS1_string=="Nisia Aigaiou and Kriti"

gen NUTS1=.
replace NUTS1=1 if NUTS1_string=="Attiki"
replace NUTS1=2 if NUTS1_string=="Voreia Ellada"
replace NUTS1=3 if NUTS1_string=="Kentriki Ellada"
replace NUTS1=4 if NUTS1_string=="Nisia Aigaiou and Kriti"

gen region1=0
replace region1=1 if region==1
gen region2=0
replace region2=1 if region==2
gen region3=0
replace region3=1 if region==3
gen region4=0
replace region4=1 if region==4

label var region1 "Attiki"
label var region2 "Voreia Ellada"
label var region3 "Kentriki Ellada"
label var region4 "Nisia Aigaiou and Kriti"


* Figure S3

foreach var of varlist contributing_1 accepting_3{
	recode `var' 99="."
	rev `var', gen(`var'_rev) 
}

label variable contributing_1_rev "Welfare norm"
label variable accepting_3_rev "Gender norm"

label define robustness 0 "Original tone" 1 "Neutral tone" 
label values robustness robustness

lab def disapprove 0 "0 Approve" 10 "10 Disapprove", replace

foreach var in contributing_1_rev accepting_3_rev {
lab values `var' disapprove
}

ciplot contributing_1_rev accepting_3_rev, by(robustness) xla(0 "0 Approve" 1 2 3 4 5 6 7 8 9 10 "10 Disapprove", ang(45)) xline(5) horizontal xscale(r(0(1)10)) ytitle("") note ("")
graph export "${PathFig}FigureS3.eps", as(eps) replace




**************************************************************************************************
*********************  Figure S4: Senitivity to statement wording ********************************
**************************************************************************************************

use "GR_recoded_stage1_2.dta", clear


label var contributing_1_rev "Welfare norm"
label var accepting_3_rev "Gender equity"
label var contributing_1_rev "Welfare norm"
label var accepting_3_rev "Gender equity"
 

* Data cleaning
label var gender_cat1 "Male"
label var age_cat1 "Age: 18-34"
label var age_cat2 "Age: 35-54"
label var age_cat3 "Age: 55-90"

label var region_GR1 "Attiki"
label var region_GR2 "Voreia Ellada"
label var region_GR3 "Kentriki Ellada"
label var region_GR4 "Nisia Aigaiou and Kriti"


drop if gender==3
gen FEMALE=0
replace FEMALE=1 if gender==2
drop age_cat age_cat1 age_cat2 age_cat3
recode age (18/34=1) (35/54=2) (55/90=3) (.2 = .), gen(age_cat)
tab age_cat, gen(age_)

gen NUTS1=.
replace NUTS1=1 if NUTS1_string=="Attiki"
replace NUTS1=2 if NUTS1_string=="Voreia Ellada"
replace NUTS1=3 if NUTS1_string=="Kentriki Ellada"
replace NUTS1=4 if NUTS1_string=="Nisia Aigaiou and Kriti"

* Figure S4

*Raw data figure
label variable contributing_1_1 "Natives"
label variable contributing_1_2 "Immigrants"
label variable accepting_3_1 "Natives"
label variable accepting_3_2 "Immigrants"


ciplot contributing_1_1 contributing_1_2 , note("") xlabel(, angle(0)) xtitle("Welfare norm violation")  rcap(lcolor(black)) name(welfare, replace) yline(50) ytitle("Likelihood of norm violation (%)") ylabel(30(5)70) 
ciplot accepting_3_1 accepting_3_2 , note("") xlabel(, angle(0)) xtitle("Gender equity norm violation")  rcap(lcolor(black)) name(gender, replace) yline(50) ytitle("Likelihood of norm violation (%)") ylabel(30(5)70) 
graph combine welfare gender, ycommon title("Greece, raw data") name(GR_beliefs_raw, replace)


* Weight data figure

mean FEMALE age_1 age_2 age_3 postsecondary region_GR1 region_GR2 region_GR3 region_GR4 right
estat sd

ipfweight FEMALE age_cat NUTS1, gen(weight_new2) val(48.6 51.4 21.2 35.4 43.3 31.3 29.5 28.1 11.1) maxiter(100) 

svyset ResponseId [pweight=weight_new2]
svy: mean FEMALE age_1 age_2 age_3 region_GR1 region_GR2 region_GR3 region_GR4
estat sd


ciplot contributing_1_1 contributing_1_2 [aweight = weight_new2], note("") xlabel(, angle(0)) xtitle("Welfare norm violation")  rcap(lcolor(black)) name(welfare_weight2, replace) yline(50) ytitle("Likelihood of norm violation (%)") ylabel(30(5)70) 
ciplot accepting_3_1 accepting_3_2 [aweight = weight_new2], note("") xlabel(, angle(0)) xtitle("Gender equity norm violation")  rcap(lcolor(black)) name(gender_weight2, replace) yline(50) ytitle("Likelihood of norm violation (%)") ylabel(30(5)70) 
graph combine welfare_weight2 gender_weight2, ycommon title("Greece, weighted data") name(GR_beliefs_weighted, replace)

* Combined S4 Figure

graph combine GR_beliefs_weighted GR_beliefs_raw, col(1) xcommon title("") 
graph export "${PathFig}FigureS4.eps", as(eps) replace










